package com.lg.controller;


import com.lg.dto.DTO;
import com.lg.service.StudentService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


@RestController
public class StudentController{



    @Resource
    StudentService studentService;
    @RequestMapping("/students")
    public DTO getAllJSon() throws Exception{
        return studentService.getAllStudents();
    }

    @RequestMapping(value = "/student/{sno}",method = RequestMethod.POST)
    public DTO getStudentBySno(@PathVariable("sno")String sno) {
        return new DTO(200,"按学号查询");
    }

}
